package com.ms.game.itembox.db;

import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Table;

import com.ms.game.common.GameType;
import com.xpec.c4.db.model.log.basic.BasicLogModel;
import com.xpec.c4.game.utility.GUID;

@Entity
@Table(name = RollItemInGameLogModel.ModelName)
@org.hibernate.annotations.Entity(dynamicInsert = true, dynamicUpdate = true)
@org.hibernate.annotations.Table(
		appliesTo = RollItemInGameLogModel.ModelName, indexes =
		{
				@org.hibernate.annotations.Index(name = "IDX_ORDER_ID", columnNames = { "orderID" }),
				@org.hibernate.annotations.Index(name = "IDX_TIME", columnNames = { "eventTime" })
		}
)
public class RollItemInGameLogModel extends BasicLogModel{

	
	public static final String ModelName = "roll_item_log";
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -510929267593180832L;

	/**遊戲類型*/
	private GameType gameType;
	
	/**館別*/
	private String hallType;
	
	/**機器編號*/
	private int machineID;
	
	/**orderID*/
	private String orderID;
	
	/**玩家ID*/
	private String playerGUID;
	
	/**玩家名稱*/
	private String playerName;
	
	/**
	 * 玩家類型<br>
	 * @see com.ms.player.PlayerUserType
	 */
	private int userType;
	
	/**
	 * 下注額
	 */
	private BigDecimal bet;
	
	/**
	 * 物品ID
	 */
	private String itemID;
	
	/**
	 * 數量
	 */
	private int count;

	@Enumerated(EnumType.STRING)
	public GameType getGameType() {
		return gameType;
	}

	public void setGameType(GameType gameType) {
		this.gameType = gameType;
	}

	public String getHallType() {
		return hallType;
	}

	public void setHallType(String hallType) {
		this.hallType = hallType;
	}

	public String getOrderID() {
		return orderID;
	}

	public void setOrderID(GUID orderID) {
		if(orderID != null)
			this.orderID = orderID.toString();
	}

	public String getPlayerGUID() {
		return playerGUID;
	}

	public void setPlayerGUID(String playerGUID) {
		this.playerGUID = playerGUID;
	}

	public String getPlayerName() {
		return playerName;
	}

	public void setPlayerName(String playerName) {
		this.playerName = playerName;
	}

	public int getUserType() {
		return userType;
	}

	public void setUserType(int userType) {
		this.userType = userType;
	}

	@Column(precision = 19, scale = 2, columnDefinition = "DECIMAL(19,2) default 0.0")
	public BigDecimal getBet() {
		return bet;
	}

	public void setBet(BigDecimal bet) {
		this.bet = bet;
	}

	public int getMachineID() {
		return machineID;
	}

	public void setMachineID(int machineID) {
		this.machineID = machineID;
	}

	public String getItemID() {
		return itemID;
	}

	public void setItemID(String itemID) {
		this.itemID = itemID;
	}

	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}

}
